Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve coverage of async/await state machine #698

Merged
merged 14 commits into from
Jan 22, 2020

Conversation

MarcoRossignoli
Copy link
Collaborator

@MarcoRossignoli MarcoRossignoli commented Jan 21, 2020

Fixes #669

Changed alg to recognize initial async/state machine branches used to check "state machine" state, some branch could not be covered due to true/false async nature of code.
Check comment of CecilSymbolHelper.GetBranchPoints for full explanation

Fixed is complete check adding netstandard scope, if we're testing netstandard project with ValueTask the scope is not System.Runtime but netstandard.

cc: @abbotware @LeMorrow @moikot

@MarcoRossignoli MarcoRossignoli added bug Something isn't working tenet-coverage Issue related to possible incorrect coverage labels Jan 21, 2020
@@ -83,15 +102,87 @@ public static List<BranchPoint> GetBranchPoints(MethodDefinition methodDefinitio
continue;
}

/*
If method is a generated MoveNext we'll skip first branches (could be a switch or a series of branches)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alg update

@@ -60,6 +60,25 @@ private static bool IsMoveNextInsideEnumerator(MethodDefinition methodDefinition
return false;
}

private static bool IsRecognizedMoveNextInsideAsyncStateMachineProlog(MethodDefinition methodDefinition)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alg update

operand.DeclaringType.Scope.Name == "System.Runtime")
(
operand.DeclaringType.Scope.Name == "System.Runtime" ||
operand.DeclaringType.Scope.Name == "netstandard"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include netstandard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tenet-coverage Issue related to possible incorrect coverage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coverage Issue - New Using + Async/Await + ConfigureAwait
1 participant